Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream enhancements #268

Draft
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Draft

stream enhancements #268

wants to merge 5 commits into from

Conversation

murali-shris
Copy link
Member

- What I did

- How I did it

- How to verify it

- Description for the changelog

var fileName = valueObject.split(':')[1];
var fileLength = int.parse(valueObject.split(':')[2]);
fileName = utf8.decode(base64.decode(fileName));
final streamNotification = StreamNotificationParser('atmosphere')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the atmosphere is typed here?

.parseStreamNotification(atNotification);
if (streamNotification == null) {
return;
}
var userResponse = true; //UI user response
if (userResponse == true) {
print('user accepted transfer.Sending ack back');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change this to log

@@ -49,7 +61,7 @@ Future<void> _notificationCallBack(AtNotification atNotification) async {
}
}

void _streamReceiveCallBack(var bytesReceived) {
void _streamProgressCallBack(var bytesReceived) {
print('Receive callback bytes received: $bytesReceived');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print .. should we retain?

var atStreamRequest = AtStreamRequest('@bob🛠', '/home/murali/Pictures/@/cat.jpeg');
atStreamRequest.namespace = 'atmosphere';
final streamSender =
atClientManager.streamService.createStream(StreamType.SEND).sender;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking "atClientManager.streamService.createStream(StreamType.SEND)" to return a StreamSender without calling a ".sender". Will discuss in a call.

onDone(atStreamResponse);
}
} else if (result != null && result.startsWith('error:')) {
result = result.replaceAll('error:', '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use the response parser

/// onDone[AtStreamResponse] is called upon stream completion.
/// onError[AtStreamResponse] is called when stream errors out.
/// If a stream transfer has to be resumed then specify [atStreamRequest.startByte]. Stream transfer will be resumed from startByte.
Future<void> send(AtStreamRequest atStreamRequest, Function onDone,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can an app send two-stream requests in parallel? i.e calling send for two files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the stream id is important for the caller to know before onDone or onError is called?

@gkc
Copy link
Contributor

gkc commented Feb 9, 2023

@murali-shris Is there code here which will be useful when we revisit stream properly? If so, please mark as draft for now, otherwise please close and delete the branch.

@murali-shris murali-shris marked this pull request as draft March 16, 2023 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants